package com.xaw.medicalcrane.utils.pageutil;

import lombok.Data;

import java.util.List;

/**
 * @author: 桂秋拾貳
 * @date: 2022/7/18 15:53
 * @description:
 */
@Data
public class PageResult {

    /**
     *页数
     */
    private int pageNum;
    /**
     * 每页的信息的个数
     */
    private int pageSize;

    /**
     * 总条数
     */
    private Long total;

    /**
     * 总页数
     */
    private int pages;

    /**
     * 结果集
     */
    private List<?> content;

    public static PageResult getPageResult(List content,PageRequest pageRequest,Long total) {
        PageResult pageResult = new PageResult();
        pageResult.setContent(content);
        pageResult.setPageNum(pageRequest.getPageNum());
        pageResult.setPageSize(pageRequest.getPageSize());
        pageResult.setTotal(total);
        return pageResult;
    }

}
